# -*- coding: utf-8 -*-
# Django settings for promosite project.
import os

PROJ_NAME = 'djwatch'
EMAIL_SUBJECT_PREFIX = '[%s error] ' % PROJ_NAME

root = os.path.dirname(__file__)
#VAR_DIR = '/var/local/%s/' % PROJ_NAME
VAR_DIR = os.path.realpath(os.path.join(root, '../../var'))

DEBUG = False
#DEBUG = True

TEMPLATE_DEBUG = DEBUG

ADMINS = (
)

SEND_BROKEN_LINK_EMAILS = False

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'sqlite3', # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
        'NAME': os.path.join(VAR_DIR, 'djwatch.sqlite'),
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    },
}

# Local time zone for this installation. Choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
#TIME_ZONE = 'America/Chicago'
TIME_ZONE = 'Europe/Moscow'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
#LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'ru'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

MEDIA_ROOT = os.path.realpath(os.path.join(root, '../../web/static'))
VAR_DIR = os.path.realpath(os.path.join(root, '../../var'))
MEDIA_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'

RRD_DIR = os.path.join(VAR_DIR, 'rrds')

# Make this unique, and don't share it with anybody.
SECRET_KEY = ';sadjf01j34j1wpedm[sdkcpasdkf;askjdfiasdjf;qj314rk'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)

TEMPLATE_DIRS = (
    os.path.join(root, 'templates'),
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
    'django.core.context_processors.auth',
    'django.core.context_processors.media',
)

#SESSION_ENGINE = "django.contrib.sessions.backends.file"
#SESSION_FILE_PATH = os.path.realpath(os.path.join(VAR_DIR, 'sessions'))

ROOT_URLCONF = '%s.urls' % PROJ_NAME

TEMPLATE_DIRS = (
    os.path.join(root, 'templates'),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.admin',
    'djwatch',
    'djwatch.notifier',
)

DEFAULT_CHARSET = 'UTF-8'

MAIL_ROBOT_ADDR = 'robot@reggi.ru'

INTERNAL_IPS = (
    '127.0.0.1',
)

SESSION_COOKIE_NAME = 'django_session_id'

LOGIN_URL = '/admin/'
LOGOUT_URL = '/admin/'
LOGIN_REDIRECT_URL = '/'

DEFAULT_AGENT_PORT = 10101
PLUGINS = (
    ('cpu', 'djwatch.coreplugins.cpu'),
    ('memory', 'djwatch.coreplugins.memory'),
    ('processes', 'djwatch.coreplugins.processes'),
    ('filesystem', 'djwatch.coreplugins.filesystem'),
    ('diskusage', 'djwatch.coreplugins.diskusage'),
)
#ENABLE_GRAPH_MARKERS = False
ENABLE_GRAPH_MARKERS = True
GRAPH_COLORS = [
    'F58549',
    '70B55C',
    '1B91E0',
    'AE00FF',
    'FF0066',
    'A37474',
#    'F7D059',
    'B4B8B8',
    '466E47',
    '000000',
    '000000',
    '000000',
    '000000',
]
